package org.test.demo.pattern.proxy.cglib;

import org.test.demo.pattern.proxy.ToCPayment;
import org.test.demo.pattern.proxy.impl.ToCPaymentImpl;

public class CglibProxyDemo {
    public static void main(String[] args) {
        AlipayMethodInterceptor methodInterceptor = new AlipayMethodInterceptor();
        CommonPayment commonPayment = new CommonPayment();
        CommonPayment commonPaymentProxy = CglibUtil.createProxy(commonPayment, methodInterceptor);
        commonPaymentProxy.pay();
        ToCPayment toCPayment = new ToCPaymentImpl();
        ToCPayment toCProxy = CglibUtil.createProxy(toCPayment, methodInterceptor);
        toCProxy.pay();
    }
}
